package com.sx.micowell.module.user.writeInfo

import android.annotation.SuppressLint
import android.graphics.Color
import android.text.TextUtils
import android.view.View
import androidx.core.view.isVisible
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.mvvm.until.GridItemDecoration
import com.example.mvvm.until.LogUtils
import com.example.mvvm.until.ToastUtils

import com.miloyu.modelnet.response.DictType
import com.miloyu.modelnet.response.getResId

import com.sx.micowell.R
import java.util.*

/**
 * @Author: YY
 * @Time: 2021/8/13
 * @Describe TODO
 */
class TrainTypeListAdapter : BaseQuickAdapter<DictType, BaseViewHolder>(R.layout.item_target_type) {

    @SuppressLint("NotifyDataSetChanged")
    override fun convert(holder: BaseViewHolder, item: DictType) {

        holder.setText(R.id.textView, item.dictLabel)

        if (item.isSelect) {
            holder.setImageResource(R.id.imageView1, context.getResId(
                "drawable", item.dictValue.lowercase(Locale.getDefault()) + "_on"))
        } else {
            holder.setImageResource(R.id.imageView1, context.getResId(
                "drawable", item.dictValue.lowercase(Locale.getDefault()) + "_off"))

        }
    }
}

